package com.itheima.day11.bytestream.test5;


import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Test {
    public static void main(String[] args) {
        /*FileInputStream fis = new FileInputStream("myCode\\src\\com\\itheima\\day11\\b.txt"); // FileNotFoundException
        int read = fis.read();
        fis.close();
        System.out.println((char)read);*/
        FileInputStream fis = null;
        try {
            fis = new FileInputStream("myCode\\src\\com\\itheima\\day11\\a.txt");
            int read = fis.read();
            if (read != -1)
                System.out.println((char) read);
        } catch (FileNotFoundException e) {
            System.out.println("没找到文件");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fis != null) {
                try {
                    System.out.println("释放内存");
                    fis.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
